<template>
  <div>
    <router-link :to="to" :class="['nav-link', 'router-link', hashover]" :active-class="activeclass">
      <i :class="['iconfont', icon, iconclass]"></i>
      <slot></slot>
    </router-link>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
  name: 'navItem',
  props: {
    to: {
      type: String,
      default: '/'
    },
    icon: {
      type: String,
      required: true
    },
    iconclass: {
      type: String,
      default: ''
    },
    showicon: {
      type: Boolean,
      default: true
    },
    activeclass: {
      type: String,
      default: 'router-link-active'
    },
    hashover: {
      type: String,
      default: ''
    }
  },
  components: {
  },
  setup (props) {
  }
})
</script>

<style scoped>
  .nav-link {
    font-size: .9rem;
  }
  .nav-link:hover {
    color: var(--text-color-hover);
  }
  .router-link-active {
    color: var(--text-color-hover);
  }
  .nav-item__label {
    padding-right: .5rem;
    padding-left: .2rem;
    /* font-size: 1rem; */
  }
  .icon {
    font-size: 1.8rem;
    color: var(--text-color-hover);
  }
</style>
